<template>

  <router-view/>
  
</template>


<script>
import axios from 'axios'
export default {
  name: "App",
  beforeCreate() {
    this.$store.commit('initializeStore')

    // 后续不需要单独设置headers
    const token = localStorage.getItem("token")
    console.log(token)
    if (token){
      axios.defaults.headers.common["Authorization"] = "JWT " + token
    }else{
      axios.defaults.headers.common["Authorization"] = ""
    }
  },
}


</script>